package org.example.springioc.V2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/9/27
 * Time: 13:27
 */
class Car{
    protected Framework framework;
    public Car(Framework framework){
        this.framework = framework;
        System.out.println("car init");
    }
    public void run() {
        System.out.println("car run");
    }
}

class Framework{
    protected Bottom bottom;
    public Framework(Bottom bottom){
        this.bottom = bottom;
        System.out.println("framework init");
    }
}

class Bottom{
    protected Tire tire;
    public Bottom(Tire tire){
        this.tire = tire;
        System.out.println("bottom init");
    }
}

class Tire{
    protected int size;
    protected String color;
    public Tire(int size, String color){
        this.size = size;
        this.color = color;
        System.out.println("tire init");
    }
}
public class Main {
    public static void main(String[] args) {
        Tire tire = new Tire(10,"blue");
        Bottom bottom = new Bottom(tire);
        Framework framework = new Framework(bottom);
        Car car = new Car(framework);
        car.run();
    }
}
